install_path = /usr/local/bin

CFLAGS = -O2 -std=c99 -fPIC -shared -Wall
LIBS = -lcrypto

gentags:
	ctags `find . -name "*.py" -or -name "*.c"`

transferHandler_extern.so: src/backend/transferHandler_extern.c
	$(CC) $(CFLAGS) $(LIBS) -o $@ $^

bundle: clean transferHandler_extern.so
	pyinstaller src/cli.py --add-binary transferHandler_extern.so:. --onefile

clean:
	rm -rf src/__pycache__ src/backend/__pycache__ \
		transferHandler_extern.so cli.spec build dist tags

install: bundle
	cp dist/cli $(install_path)/remoteFileMgr
